package demo.comm;

import java.util.HashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import demo.controller.StatusController;

@RestControllerAdvice
public class ControllerErrorAdvice{
	
	private static final Logger log = LoggerFactory.getLogger(StatusController.class);

	/*
	// @ExceptionHandler(value = Exception.class)
    // public Map<String,Object> errorHandler(Exception e) {
    @ExceptionHandler(value = Throwable.class)
    public Map<String,Object> errorHandler(Throwable e) {
		log.error("errorHandler", e);
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("errorMsg", e+"");          
        return map;
    }
    */

}